home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 25 Years Anniversary
/
CHIP_25Jahre_Jubilaeum.iso
/
G DATA AddOns2
/
WebShop
/
_SETUP.1
/
sb2basket.js
< prev
next >
Wrap
Text File
|
2001-12-20
|
11KB
|
216 lines
<!-- sb2basket Basket functions -->
<!-- (c) Copyright 2001 GS Software -->
<!-- -->
<SCRIPT LANGUAGE="JavaScript">
function showItems()
{
var tablerowcolor = '#F0F0F0';
totprice = 0;
totvat = 0;
document.writeln('<!-- Begin Form updateform from permbasket.js -->');
document.writeln('<FORM NAME="updateform">');
if (parent.theBasket.length>1) {
document.writeln('<DIV align="left">');
document.writeln('<TABLE class="basket" WIDTH=100% BORDER=0 CELLPADDING="2">');
document.writeln('<TR BGCOLOR="#C0C0C0"><TD class="basket"><b>'+parent.Loc_Article+'</b></TD><TD class="basket" align="right"><b>'+parent.Loc_Quantity+'</b></TD><TD class="basket" align="right"><b>'+parent.Loc_PriceEach+'</b></TD><td class="basket" align="right"><b>'+parent.Loc_PriceTotal+'</b></TD><TD class="basket"> </TD></TR>');
document.writeln('<TR BGCOLOR="F8F8F8"><TD class="basket" colspan="5"><HR></TD></TR>');
}
else {
document.writeln('<DIV align="left">');
document.writeln('<TABLE class="basket" WIDTH=100% BORDER=0 CELLPADDING="2">');
document.writeln('<TR BGCOLOR="#C0C0C0"><TD class="basket"><b>'+parent.Loc_Article+'</b></TD><TD class="basket" align="right"><b>'+parent.Loc_Quantity+'</b></TD><TD class="basket" align="right"><b>'+parent.Loc_PriceEach+'</b></TD><td class="basket" align="right"><b>'+parent.Loc_PriceTotal+'</b></TD><TD class="basket"> </TD></TR>');
document.writeln('<TR BGCOLOR="F8F8F8"><TD class="basket" colspan="5"><HR></TD></TR>');
document.writeln('<TR BGCOLOR="F8F8F8"><TD class="basket" colspan="5"><B>'+parent.Loc_BasketEmpty+'</B></TD></TR>');
// document.writeln('</TABLE>');
}
// NEU
if (parent.theBasket.length>1) {
for (var i = 1; i < parent.theBasket.length; i++)
{
with(parent.theBasket[i])
{
theitem=Item;
thequantity = Quantity; //fulllist.substring(itemstart, itemend);
itemtotal = 0;
if ((parseFloat(Price2)>0) && (parseInt(Quantity) >= parseInt(Quantity2)))
theprice=Price2
else
if ((parseFloat(Price1)>0) && (parseInt(Quantity) >= parseInt(Quantity1)))
theprice=Price1
else
theprice = Price;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
totprice = totprice + itemtotal;
thisvat = (parseFloat(itemtotal*productvatrate)) / (parseFloat(productvatrate)+parseFloat(100));
thisvat = parseFloat(parent.alterError(thisvat));
totvat = totvat + thisvat;
if(Attribut1=='') A1=''; else A1=', '+Attribut1;
if(Attribut2=='') A2=''; else A2=', '+Attribut2;
if(Attribut3=='') A3=''; else A3=', '+Attribut3;
itemlist=i;
hilf="";
if (Textin != "") hilf="<br> "+Textin;
document.write('<tr valign="top" BGCOLOR="'+tablerowcolor+'"><td class="basket">'+theitem+A1+A2+A3+hilf+'</td> ');
document.write('<td nowrap class="basket" valign="top" align="right"><INPUT TYPE=TEXT class="inputbox" NAME="quant'+itemlist+'" VALUE="'+thequantity+'" SIZE=3> <a href="javascript:amendItem('+itemlist+',document.updateform.quant'+itemlist+'.value)"><img src="ok.gif" width="8" height="8" border="0" alt="Menge aktualisieren"></a> </td><td class="basket" valign="top" align="right">'+parent.alterError(theprice)+'</td><td class="basket" valign="top" align="right">'+parent.alterError(itemtotal)+'</td><td class="basket" align="center" valign="top"> <a href="javascript:removeItem('+itemlist+')"><img src="x.gif" width="8" height="8" border="0" alt="Artikel aus dem Warenkorb entfernen"></a> </td></tr>');
if (tablerowcolor == '#F0F0F0')
tablerowcolor = "#F8F8F8";
else
tablerowcolor = "#F0F0F0";
}
}
document.writeln('<TR BGCOLOR="FCFCFC"><TD class="basket" colspan="5"><HR></TD></TR>');
document.writeln('<tr BGCOLOR="#C0C0C0"><td class="basket" colspan=3><b>'+parent.Loc_Total+'</b></td><td class="basket" align=right><b>{Currency} '+parent.alterError(totprice)+'</b></td><td class="basket"> </td></tr>');
{IfUseCurrency1}
document.writeln('<TR BGCOLOR="#C0C0C0"><td class="basket" colspan=3>'+parent.Loc_InEuro+' {Currency1} '+parent.alterError(totprice*{CURRENCYCONVERTER1})+'</td><td class="basket" align=right></td><td class="basket"></td></tr>');
{ElseIfUseCurrency1}
{EndIfUseCurrency1}
{IFSHOWVAT}
// document.writeln('<tr BGCOLOR="#C0C0C0"><td class="basket">'+parent.Loc_VAT+'</td><td class="basket" align=right colspan=2> '+{VATRATE}+" %"+'</td><td class="basket" align=right>{Currency} '+parent.alterError(totprice*{VATRATE}/({VATRATE}+100))+'</td><td class="basket"> </td></tr>');
// document.writeln('<tr BGCOLOR="#C0C0C0"><td class="basket" colspan=3>'+parent.Loc_VAT+': {Currency} '+parent.alterError(totvat)+'</td><td class="basket" align=right></td><td class="basket"> </td></tr>');
{ENDIFSHOWVAT}
}
document.writeln('</TABLE><cr>');
document.writeln('</div>');
document.writeln('</FORM>');
document.writeln('<!-- End Form updateform from permbasket.js -->');
}
function amendItem(itemno, newquant)
{
if (!( (parseFloat(newquant) == parseInt(newquant) )&&( parseInt(newquant) > 0) ))
alert(parent.Loc_Integer);
else
parent.theBasket[parseInt(itemno)].Quantity=newquant;
self.location = "basket.htm";
parent.basketframe.location = "permbasket.htm";
}
function removeItem(itemno)
{
parent.theBasket=parent.theBasket.slice(0,itemno).concat(parent.theBasket.slice(itemno+1,parent.theBasket.length));
self.location = "basket.htm";
parent.basketframe.location = "permbasket.htm";
}
function clearBasket()
{
if (confirm(parent.Loc_RemoveConfirm))
parent.theBasket=parent.theBasket.slice(0,1);
self.location = "basket.htm";
parent.basketframe.location = "permbasket.htm";
}
function xminiBasket()
{
var tablerowcolor = '#F0F0F0';
totprice = 0;
if (parent.theBasket.length>1) {
for (var i = 1; i < parent.theBasket.length; i++)
{
with(parent.theBasket[i])
{
theitem=Item;
thequantity = Quantity; //fulllist.substring(itemstart, itemend);
itemtotal = 0;
if ((parseFloat(Price2)>0) && (parseInt(Quantity) >= parseInt(Quantity2)))
theprice=Price2
else
if ((parseFloat(Price1)>0) && (parseInt(Quantity) >= parseInt(Quantity1)))
theprice=Price1
else
theprice = Price;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
totprice = totprice + itemtotal;
if(Attribut1=='') A1=''; else A1=', '+Attribut1;
if(Attribut2=='') A2=''; else A2=', '+Attribut2;
if(Attribut3=='') A3=''; else A3=', '+Attribut3;
itemlist=i;
hilf="";
if (Textin != "") hilf="<br> "+Textin;
}
}
document.writeln('<table class="basketsmall" width="100%" border="0" cellspacing="0" cellpadding="0">');
document.writeln('<tr BGCOLOR="#F8F8F8">');
document.write('<td width="50" nowrap class="basketsmall" align="left" valign="top"> <a href="main.htm" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_home.gif" border="0" align="absmiddle" alt="Home"></a>');
document.write(' <a href="basket.htm" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_fragezeichen.gif" border="0" align="absmiddle" alt="Warenkorb anzeigen"></a>');
document.writeln('</td>');
document.writeln('<td width="200" nowrap class="basketsmall" align="left" valign="top" nowrap>');
document.writeln((parent.theBasket.length-1)+ ' '+parent.Loc_InBasket+'</td>');
document.writeln('</td>');
document.write('<td class="basketsmall" align="right" valign="top" nowrap>');
document.write(parent.alterError(totprice));
document.write(' {Currency}');
{IFUSECURRENCY1}
document.write(' ('+parent.alterError(totprice*{CURRENCYCONVERTER})+' Euro)');
{ENDIFUSECURRENCY1}
document.writeln('</td>');
document.writeln('</tr>');
document.writeln('</table>');
}
else {
document.writeln('<table class="basketsmallempty" width="100%" border="0" cellspacing="0" cellpadding="0">');
document.writeln('<tr>'); // BGCOLOR="#C0C0C0"
document.write('<td width="50" nowrap class="basketsmallempty" align="left" valign="top"> <a href="main.htm" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_home.gif" border="0" align="absmiddle" alt="Home"></a>');
document.write(' <a href="basket.htm" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_fragezeichen.gif" border="0" align="absmiddle" alt="Warenkorb anzeigen"></a>');
document.writeln('</td>');
document.writeln('<td width="200" nowrap class="basketsmallempty" align="left" valign="top">'+parent.Loc_BasketEmpty);
document.writeln('</td>');
document.writeln('<td class="basketsmallempty" align="right" valign="top"> </td>');
document.writeln('</tr>');
document.writeln('</table>');
}
}
</SCRIPT>